package cn.fbs.util;/**
 * @program: BQ
 * @description: offices文件转换
 * @author: 张丽婧
 * @create: 2020-12-25 16:47
 */


import com.aspose.words.Document;
import com.aspose.words.SaveFormat;

import java.io.FileOutputStream;


/**
 * @program: BQ
 * @description: offices文件转换
 * @author: 张丽婧
 * @create: 2020-12-25 16:47
 **/
public class WordToPdfUtil {

  public static void wordToPdf( String fileUrl, String newFileUrl)
      throws Exception {
    FileOutputStream os = new FileOutputStream(newFileUrl);
    Document document = new Document(fileUrl);
    document.save(os, SaveFormat.PDF);
    os.close();
  }

  public static void main(String[] args) throws Exception {
    WordToPdfUtil.wordToPdf("C:\\Users\\Administrator\\Desktop\\文件\\南部大屏文档\\大屏用户手册.doc",
            "C:\\Users\\Administrator\\Desktop\\文件\\南部大屏文档\\大屏用户手册2.pdf");
  }


}
